package com.power.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateToStringUtil {
	public static String convert2String(Date date1, String format){
		Date date = new Date();
		String ls_ret = "";
		SimpleDateFormat df = new SimpleDateFormat(format);
		try {
			if (date1 == null) {
				ls_ret = df.format(date);
			} else {
				ls_ret = df.format(date1);
			}
		} catch (Exception e) {
			ls_ret = "";
		}
		return ls_ret;
	}
}
